package me.youline.dataServer.entity.socialActionMsg;

import java.util.Date;

import me.youline.dataServer.entity.socialActionMsg.SocialActionMsgNotifyRecord.NotifyMsgType;

public abstract class SocialActionBaseMsg {

	private Long id;
	
	private Long initiatorId;
	
	private Long targetId;
	
	private Long notifiedUserId;
	
	private Date createTime;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getInitiatorId() {
		return initiatorId;
	}

	public void setInitiatorId(Long initiatorId) {
		this.initiatorId = initiatorId;
	}

	public Long getTargetId() {
		return targetId;
	}

	public void setTargetId(Long targetId) {
		this.targetId = targetId;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Long getNotifiedUserId() {
		return notifiedUserId;
	}

	public void setNotifiedUserId(Long notifiedUserId) {
		this.notifiedUserId = notifiedUserId;
	}
	

	public abstract NotifyMsgType getMsgType();

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((initiatorId == null) ? 0 : initiatorId.hashCode());
		result = prime * result
				+ ((notifiedUserId == null) ? 0 : notifiedUserId.hashCode());
		result = prime * result
				+ ((targetId == null) ? 0 : targetId.hashCode());
		return result;
	}
	

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SocialActionBaseMsg other = (SocialActionBaseMsg) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (initiatorId == null) {
			if (other.initiatorId != null)
				return false;
		} else if (!initiatorId.equals(other.initiatorId))
			return false;
		if (notifiedUserId == null) {
			if (other.notifiedUserId != null)
				return false;
		} else if (!notifiedUserId.equals(other.notifiedUserId))
			return false;
		if (targetId == null) {
			if (other.targetId != null)
				return false;
		} else if (!targetId.equals(other.targetId))
			return false;
		return true;
	}
	
	

}
